<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="org.liufeng.course.util.*"%>
<%@ page language="java"
	import="java.sql.*,java.net.*,java.util.*,java.text.*,java.io.*,java.net.*"%>
<%
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
 
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String x = request.getParameter("x");
String y = request.getParameter("y");
String name = request.getParameter("name");
String cont = URLDecoder.decode(StrTools.doNull(request.getParameter("cont")),"UTF-8");
x="121.506372";
y="29.597407";
if(StrTools.isEmpty(x)||StrTools.isEmpty(y)){
	out.print("<p style=\"font-size:24;\">暂无数据~~</p>");
}
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta name="viewport"
	content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<html>
<head>
<base href="<%=basePath%>">

<title>百度地图</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=Ec2chH8MHnfQo9cUi0ga6jw9"></script>
<title>可视区域内的搜素</title>
<script type="text/javascript">
	jQuery.ajaxSetup ({
	   		 cache:false
	    })
	    
	 var url = "http://api.map.baidu.com/geoconv/v1/?coords="+<%=x%>+","+<%=y%>+"&from=1&to=5&ak=Ec2chH8MHnfQo9cUi0ga6jw9";
	 var mapx;
	 var mapy;
	 var title = '<%=name%>';
	 var content = '<%=cont%>';
	 $.ajax({ 
           type: "get", 
           url: url, 
           dataType: "json", 
           headers: { 'Access-Control-Allow-Origin': '*' }, 
           crossDomain: true,
           success: function (data) { 
           		var tmp = data.result;
                 mapx = tmp[0].x;
                 mapy = tmp[0].y;
                var mapurl="http://api.map.baidu.com/marker?location="+mapy+","+mapx;
                //+"&title="+title+"&content="+content+"&output=html";
                window.location=mapurl;
           }                            
     });
     
     
  
     
	 
	</script>
</head>

<body>
	
</body>
</html>



